\documentclass[a4paper]{article}

\usepackage{pgfplots}

\pgfplotsset{compat=1.8}

\begin{document}

\fbox{%
\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		xmin=0,
		xmax=1,
		ymin=0,
		ymax=1,
	]
	\addplot coordinates {(-1,-1) (2,2)};
	\end{axis}
\end{tikzpicture}%
}%
\end{document}

